﻿package 
{
	
	/**
	 * ...
	 * @author Javin
	 */
	import flash.display.Sprite;
	import flash.text.TextField;
	import Person;
	public class World extends Sprite
	{
		public function World() {
			var rmb:Money = new Money();
			var dollar:Dollar = new Dollar();
			var euro:Euro = new Euro();
			
			rmb.exchange(100);
			dollar.exchange(100);
			euro.exchange(100);
		}
	}
}

class Money {
	protected var _name:String;
	protected var _rate:Number;
	public function Money() {
		init();
	}
	protected function init():void {
		_name = 'RMB(default)';
		_rate = 1;
	}
	public function exchange(num:Number):void {
		trace(_name +':'+(num * _rate));
	}
}
class Dollar extends Money {
	override protected function init():void {
		_name = 'USD';
		_rate = 6.8;
	}
}
class Euro extends Money {
	override protected function init():void {
		_name = 'EUR'
		_rate = 10.12;
	}
}